#ifndef ASSETMANAGER_H
#define ASSETMANAGER_H
#include "StompedReality/Base.h"
#include "StompedReality/Core.h"
#include "StompedReality/Core/GameAccess.h"
namespace StompedReality {

namespace Asset {

class TextureSystem;
class PatchSystem;
struct TextureInfo;
struct PatchInfo;

/*!
 *
 * \author	Stefan Kazalski
 *
 * \brief	Asset System.
 *
 *    Manages assest:
 *     - Textures
 *     - Patches
 */
class DLL_EXPORT AssetManager : public StompedReality::GameAccess {
 private:

  TextureSystem* m_TextureSystem;
  PatchSystem* m_PatchSystem;

 public:

  //! \brief	Constructor.
  AssetManager( );

  //! \brief	Destructor.
  ~AssetManager( );

  void InitSubSystems( );

  /*!
   * \brief		Parses the render systems properties.
   *
   * \param		root	The json root.
   *
   * \return	True if success otherwise false.
   */
  virtual bool ParseConfig ( JsonPTR root );

  //! \brief	Texture info getter.
  const TextureInfo GetTextureInfo ( ID id );

  //! \brief	GL texture binding info getter.
  const ID GetGLTextureBindingID ( ID id );

  //! \brief	Texture exists check.
  bool HasTextureInfo ( ID id );

  //! \brief	Patch info getter.
  const PatchInfo GetPatchInfo ( ID id );

  //! \brief	GL Patch binding info getter.
  const ID GetGLPatchBindingID ( ID id );

  //! \brief	Patch exists check.
  bool HasPatchInfo ( ID id );

  bool OpenTexture ( StompedReality::Asset::TextureInfo& info, const char* fileName );
};

}
}
#endif // ifndef ASSETMANAGER_H